// Code generated by protoc-gen-go-grpc. DO NOT EDIT.

package cli_pb

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	emptypb "google.golang.org/protobuf/types/known/emptypb"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion7

// ManagerServiceClient is the client API for ManagerService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type ManagerServiceClient interface {
	Status(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*StatusResponse, error)
	NetInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*NetInfoResponse, error)
	AvailableVersions(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*AvailableVersionsResponse, error)
	PruneBlocks(ctx context.Context, in *PruneBlocksRequest, opts ...grpc.CallOption) (ManagerService_PruneBlocksClient, error)
	DealPeer(ctx context.Context, in *DealPeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	Dashboard(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (ManagerService_DashboardClient, error)
}

type managerServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewManagerServiceClient(cc grpc.ClientConnInterface) ManagerServiceClient {
	return &managerServiceClient{cc}
}

func (c *managerServiceClient) Status(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*StatusResponse, error) {
	out := new(StatusResponse)
	err := c.cc.Invoke(ctx, "/cli_pb.ManagerService/Status", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *managerServiceClient) NetInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*NetInfoResponse, error) {
	out := new(NetInfoResponse)
	err := c.cc.Invoke(ctx, "/cli_pb.ManagerService/NetInfo", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *managerServiceClient) AvailableVersions(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*AvailableVersionsResponse, error) {
	out := new(AvailableVersionsResponse)
	err := c.cc.Invoke(ctx, "/cli_pb.ManagerService/AvailableVersions", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *managerServiceClient) PruneBlocks(ctx context.Context, in *PruneBlocksRequest, opts ...grpc.CallOption) (ManagerService_PruneBlocksClient, error) {
	stream, err := c.cc.NewStream(ctx, &_ManagerService_serviceDesc.Streams[0], "/cli_pb.ManagerService/PruneBlocks", opts...)
	if err != nil {
		return nil, err
	}
	x := &managerServicePruneBlocksClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type ManagerService_PruneBlocksClient interface {
	Recv() (*PruneBlocksResponse, error)
	grpc.ClientStream
}

type managerServicePruneBlocksClient struct {
	grpc.ClientStream
}

func (x *managerServicePruneBlocksClient) Recv() (*PruneBlocksResponse, error) {
	m := new(PruneBlocksResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *managerServiceClient) DealPeer(ctx context.Context, in *DealPeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/cli_pb.ManagerService/DealPeer", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *managerServiceClient) Dashboard(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (ManagerService_DashboardClient, error) {
	stream, err := c.cc.NewStream(ctx, &_ManagerService_serviceDesc.Streams[1], "/cli_pb.ManagerService/Dashboard", opts...)
	if err != nil {
		return nil, err
	}
	x := &managerServiceDashboardClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type ManagerService_DashboardClient interface {
	Recv() (*DashboardResponse, error)
	grpc.ClientStream
}

type managerServiceDashboardClient struct {
	grpc.ClientStream
}

func (x *managerServiceDashboardClient) Recv() (*DashboardResponse, error) {
	m := new(DashboardResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// ManagerServiceServer is the server API for ManagerService service.
// All implementations must embed UnimplementedManagerServiceServer
// for forward compatibility
type ManagerServiceServer interface {
	Status(context.Context, *emptypb.Empty) (*StatusResponse, error)
	NetInfo(context.Context, *emptypb.Empty) (*NetInfoResponse, error)
	AvailableVersions(context.Context, *emptypb.Empty) (*AvailableVersionsResponse, error)
	PruneBlocks(*PruneBlocksRequest, ManagerService_PruneBlocksServer) error
	DealPeer(context.Context, *DealPeerRequest) (*emptypb.Empty, error)
	Dashboard(*emptypb.Empty, ManagerService_DashboardServer) error
	mustEmbedUnimplementedManagerServiceServer()
}

// UnimplementedManagerServiceServer must be embedded to have forward compatible implementations.
type UnimplementedManagerServiceServer struct {
}

func (UnimplementedManagerServiceServer) Status(context.Context, *emptypb.Empty) (*StatusResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Status not implemented")
}
func (UnimplementedManagerServiceServer) NetInfo(context.Context, *emptypb.Empty) (*NetInfoResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method NetInfo not implemented")
}
func (UnimplementedManagerServiceServer) AvailableVersions(context.Context, *emptypb.Empty) (*AvailableVersionsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method AvailableVersions not implemented")
}
func (UnimplementedManagerServiceServer) PruneBlocks(*PruneBlocksRequest, ManagerService_PruneBlocksServer) error {
	return status.Errorf(codes.Unimplemented, "method PruneBlocks not implemented")
}
func (UnimplementedManagerServiceServer) DealPeer(context.Context, *DealPeerRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DealPeer not implemented")
}
func (UnimplementedManagerServiceServer) Dashboard(*emptypb.Empty, ManagerService_DashboardServer) error {
	return status.Errorf(codes.Unimplemented, "method Dashboard not implemented")
}
func (UnimplementedManagerServiceServer) mustEmbedUnimplementedManagerServiceServer() {}

// UnsafeManagerServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ManagerServiceServer will
// result in compilation errors.
type UnsafeManagerServiceServer interface {
	mustEmbedUnimplementedManagerServiceServer()
}

func RegisterManagerServiceServer(s *grpc.Server, srv ManagerServiceServer) {
	s.RegisterService(&_ManagerService_serviceDesc, srv)
}

func _ManagerService_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(emptypb.Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ManagerServiceServer).Status(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/cli_pb.ManagerService/Status",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ManagerServiceServer).Status(ctx, req.(*emptypb.Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _ManagerService_NetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(emptypb.Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ManagerServiceServer).NetInfo(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/cli_pb.ManagerService/NetInfo",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ManagerServiceServer).NetInfo(ctx, req.(*emptypb.Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _ManagerService_AvailableVersions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(emptypb.Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ManagerServiceServer).AvailableVersions(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/cli_pb.ManagerService/AvailableVersions",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ManagerServiceServer).AvailableVersions(ctx, req.(*emptypb.Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _ManagerService_PruneBlocks_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(PruneBlocksRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(ManagerServiceServer).PruneBlocks(m, &managerServicePruneBlocksServer{stream})
}

type ManagerService_PruneBlocksServer interface {
	Send(*PruneBlocksResponse) error
	grpc.ServerStream
}

type managerServicePruneBlocksServer struct {
	grpc.ServerStream
}

func (x *managerServicePruneBlocksServer) Send(m *PruneBlocksResponse) error {
	return x.ServerStream.SendMsg(m)
}

func _ManagerService_DealPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DealPeerRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ManagerServiceServer).DealPeer(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/cli_pb.ManagerService/DealPeer",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ManagerServiceServer).DealPeer(ctx, req.(*DealPeerRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ManagerService_Dashboard_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(emptypb.Empty)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(ManagerServiceServer).Dashboard(m, &managerServiceDashboardServer{stream})
}

type ManagerService_DashboardServer interface {
	Send(*DashboardResponse) error
	grpc.ServerStream
}

type managerServiceDashboardServer struct {
	grpc.ServerStream
}

func (x *managerServiceDashboardServer) Send(m *DashboardResponse) error {
	return x.ServerStream.SendMsg(m)
}

var _ManagerService_serviceDesc = grpc.ServiceDesc{
	ServiceName: "cli_pb.ManagerService",
	HandlerType: (*ManagerServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Status",
			Handler:    _ManagerService_Status_Handler,
		},
		{
			MethodName: "NetInfo",
			Handler:    _ManagerService_NetInfo_Handler,
		},
		{
			MethodName: "AvailableVersions",
			Handler:    _ManagerService_AvailableVersions_Handler,
		},
		{
			MethodName: "DealPeer",
			Handler:    _ManagerService_DealPeer_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "PruneBlocks",
			Handler:       _ManagerService_PruneBlocks_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "Dashboard",
			Handler:       _ManagerService_Dashboard_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "manager.proto",
}
